#include "GameMessage.h"
#include "Timer.h"

#include <iostream>

GameMessage::GameMessage()
{
	m_timeStamp = 0;
}

//GameMessage::GameMessage(int timeStamp)
//{
//	m_timeStamp = timeStamp;
//}

void GameMessage::Write(SocketMessage* sm)
{
	//m_timeStamp = TheTimer::Instance()->GetTimeMS();
}

bool GameMessage::operator<(const GameMessage& gm) const
{
	return m_timeStamp < gm.m_timeStamp;
}

float GameMessage::GetTimeDiff()
{
	float curTime = TheTimer::Instance()->GetTimeMS();
	//std::cout << "GetTimeDiff ts: " << m_timeStamp << std::endl;
	curTime -= m_timeStamp;
	return curTime;
	//return TheTimer::Instance()->GetTime() - m_timeStamp;
}

void GameMessage::SetTimeStamp(unsigned int ts)
{
	m_timeStamp = ts;
}